package org.lcc.Service;

import org.lcc.model.VO.*;
import org.lcc.model.dto.*;
import org.lcc.model.entity.Class;
import org.lcc.model.entity.Exam;
import org.lcc.model.entity.Question;
import org.lcc.model.request.AddExamQuestionRequest;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface ExaminationmanagementService {
    //创建考试
    Integer createExam(ExamDto examDto);

    //查询题库
    List<QuestionVO> showExam(String schoolNumber);

    //查询题库各类题型数量等信息
    List<QuestionDataVo> getNumberOfDifferentTypes(String questionName);

    //随机出题
    Boolean randomQuestion(QuestionBankDto questionBankDto, Integer examId);

    //手动出题
    Boolean manualQuestion(Integer examId, QuestionIdDto questionId);

    //根据题库题型显示题目供用户手动选择
    List<QuestionTypemanualVo> getManualQuestion(String questionName);

    //发布考试
    PublishExamResultDto publishExam(PubishExamDto pub);

    //根据学生school_Number来查询到需要进行的考试
    List<ExamListVo> getExam(String schoolNumber);

    //通过考试id(examId)去查询到具体的考试试题
    ExamQuestionVO getExamQuestion(Integer examId);

    ////考生的答案提交
    String submitAnswer(AnswerDto answerDto);

    //查询主观题
    List<Subjective_questionVo> seletQuery_subjective(Integer examID, String studentID);

    //人工评卷后对其数据库更新
    Boolean updateExamStatus(List<SubjectiveAnswerDto> subjectiveAnswerDto);

    // 获取教师创建的所有班级
    List<Class> getTeacherClasses(String teacherId);

    // 获取教师所有班级中的学生
    List<StudentVO> getTeacherStudents(String teacherId);

    //获取考试试题预览
    List<QuestionPreviewVo> getExamPreview(Integer examId);

    //获取教师创建的考试
    List<ExamVO> getteacherIdExam(String teacherId, String status, Integer pageNum, Integer pageSize, String searchText);

    // 获取考试详情
    ExamVO getExamDetail(Integer examId);

    // 更新考试信息
    boolean updateExamInfo(Exam exam);

    /**
     * 获取老师创建的所有题库
     */
    List<QuestionVO> getQuestionBanks(String teacherId);

    /**
     * 获取指定题库中的所有试题
     */
    List<Question> getQuestionsByBank(String questionBankName);
    /**
     * 添加考试试题
     * @param request 添加试题请求
     * @return 是否添加成功
     */
    boolean addExamQuestions(AddExamQuestionRequest request);
    // 删除试题
    void deleteQuestion(Integer examId, Integer questionId);
    //删除试卷
    void deleteExams(List<Integer> examIds);
    //获取最近考试
    List<Exam> getRecentExams(String schoolNumber);
    //获取考生已经作答的考试
    List<ExamRecordoneVO> getExamstudentAnswer(String schoolNumber);
    //处理主观题为空的请情况
    Boolean updateExamStatusNull(String examId, String schoolNumber);
}
